Repository navigation
Mockgun: honour limit and page in find - #468
Open
patrickwolf wants to merge 1 commit into
Open
patrickwolf wants to merge 1 commit into
patrickwolf wants to merge 1 commit into
Conversation
find accepted limit and page and returned every match. They are now applied after the ordering, with the same validation as Shotgun.find; a page without a limit holds 500 records, the server's default. find_one asks for one record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
patrickwolf
force-pushed
the
mockgun-limit-and-page
branch
from
November 16, 2026 17:45
79d3780 to
1e16ad5
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Mockgun.findacceptslimitandpagebut ignores them and returns every match. Code that asks for "the newest three Versions" gets all of them, so it can pass under Mockgun and answer differently on a real site.Change
limitandpageare applied after the ordering, as on the server:limitalone returns the firstlimitrecords;pagereturns that page, oflimitrecords, or of 500 records (the server's defaultapi_max_entities_per_page) when no limit is given.Shotgun.findvalidates them: a negative or non-int value raisesValueError.find_onepasseslimit=1.Tests
TestLimitAndPage: limit, pages including one past the end, limit after a descending order, and invalid values.Merge order
Independent of the other Mockgun PRs (field types, default value types, upload), but each of them also adds its test class at the end of
tests/test_mockgun.py, and "field types" also adds a constant next to this one's below the imports ofmockgun.py. Whichever is merged later needs a rebase that keeps both sides.